package com.soft.javase.day03.practice.system;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/17
 */
public class Manager extends Employee {
    private double bonus;  // 分红

    public Manager(String name, String id, double salary, double bonus) {
        super(name, id, salary);
        this.bonus = bonus;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    // 涨薪
    @Override
    public void addSalary(double amount) {
        setSalary(getSalary() + amount);
        this.bonus += amount * 0.1;  // 10%分红
    }

    @Override
    public String toString() {
        return "Manager{" +
                "name='" + getName() + '\'' +
                ", id='" + getId() + '\'' +
                ", salary=" + getSalary() +
                ", bonus=" + bonus +
                '}';
    }

}